import { createTempOrderNo, currentUserID } from "@/utils/common.js";
import { utils } from 'hi-ui';
//验收入库数据集配置
export default {
    id: "InspectEntity",
    returnTotal:true,
    modelFile: "purchase/inspect/dataset/InspectEntity.xml",
    sortFields: [
        "FID",
        "FNUMBER",
        "FPURCHASINGNUMBER",
        "FSTORAGE",
        "FNOTE",
        "FAUDIT",
        "FCREATEDATE",
        "FMONEY",
        "FUSERID",
        "FSETTLEMRNT",
        "FSUPPLIER",
        "FSUPPLIERID",
        "FENTERPRISEDESC",
        "FENTERPRISEID",
        "FSHOPDESC",
        "FSHOPDESCID"
    ],
    fields: {
        FID: {
            name: "FID", //字段ID
            label: "ID", //字段描述
            dbtype: "dbString", //数据类型
            default: {
                //默认值
                //rule: 'first', //prior   填充规则
                exps: (data) => {
                    //填充表达式
                    return utils.string.guid();
                },
            },
        },

        FNUMBER: {
            name: "FNUMBER", //字段ID
            label: "单号", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            readonly: true,
            length: 25,
            default: {
                //默认值
                //rule: 'first', //prior   填充规则
                exps: (data) => {
                    //填充表达式
                    return createTempOrderNo();
                },
            },
        },

        FUSERID: {
            name: "FUSERID", //字段ID
            label: "创建人", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            readonly: true,
            length: 25,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return currentUserID();
                },
            },
        },

        FCREATEDATE: {
            name: "FCREATEDATE", //字段ID
            label: "创建时间", //字段描述
            dbtype: "dbDate", //数据类型
            required: true,
            readonly: true,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return utils.date.format(new Date(), "yyyy-MM-dd HH:mm:ss");
                },
            },
        },

        FPURCHASINGNUMBER: {
            name: "FPURCHASINGNUMBER", //字段ID
            label: "采购单", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            readonly: true,
            length: 25,
        },

        FSUPPLIER: {
            name: "FSUPPLIER", //字段ID
            label: "供应商", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            readonly: true,

        },
        FSUPPLIERID: {
            name: "FSUPPLIERID", //字段ID
            label: "供应商ID", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            readonly: true,

        },

        FMONEY: {
            name: "FMONEY", //字段ID
            label: "总金额 ", //字段描述
            dbtype: "dbFloat", //数据类型
            required: true,
            readonly: true,

        },
        FSHOPDESC: {
            name: "FSHOPDESC", //字段ID
            label: "店铺", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            required: true,
        },
        FSHOPDESCID: {
            name: "FSHOPDESCID", //字段ID
            label: "店铺编号", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            required: true,
        },
        FSTORAGE: {
            name: "FSTORAGE", //字段ID
            label: "仓库", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },

        FNOTE: {
            name: "FNOTE", //字段ID
            label: "备注", //字段描述
            dbtype: "dbString", //数据类型
            length: 250,

        },
        FENTERPRISEDESC: {
            name: "FENTERPRISEDESC", //字段ID
            label: "企业名称", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FENTERPRISEID: {
            name: "FENTERPRISEID", //字段ID
            label: "企业ID", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FAUDIT: {
            name: "FAUDIT", //字段ID
            label: "审核", //字段描述
            dbtype: "dbInt", //数据类型
        },
        FSETTLEMRNT: {
            name: "FSETTLEMRNT", //字段ID
            label: "结算标识", //字段描述
            dbtype: "dbInt", //数据类型
        },
    },

}